<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      KDE Frameworks 5 Pre-installation Configuration
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;30.&nbsp;KDE Frameworks 5
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="kf5.html" title="KDE Frameworks 5">Prev</a>
          <p>
            KDE Frameworks 5
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="krameworks5.html" title=
          "Building KDE Frameworks 5 (KF5)">Next</a>
          <p>
            Building KDE Frameworks 5 (KF5)
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="kf5.html" title=
          "Chapter&nbsp;30.&nbsp;KDE Frameworks 5">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="kf5-intro" name="kf5-intro"></a>KDE Frameworks 5
        Pre-installation Configuration
      </h1>
      <p>
        KF5 can be installed in <code class="filename">/usr</code> or
        <code class="filename">/opt/kf5</code>. The BLFS editors recommend
        the latter in the BLFS environment.
      </p>
      <div class="sect2" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installing in /usr
        </h2>
        <p>
          One option is to install <span class="application">KDE Frameworks
          5</span> into the <code class="filename">/usr</code> hierarchy.
          This creates a simpler setup but makes it more difficult to try
          multiple versions of <span class="application">KDE
          Frameworks</span>.
        </p>
        <pre class="userinput">
<kbd class="command">export KF5_PREFIX=/usr</kbd>
</pre>
        <p>
          It is a good idea to add the following variables to your system or
          personal profiles:
        </p>
        <pre class="root">
<kbd class="command">cat &gt;&gt; /etc/profile.d/qt5.sh &lt;&lt; "EOF"
<code class="literal"># Begin kf5 extension for /etc/profile.d/qt5.sh

pathappend /usr/lib/qt5/plugins    QT_PLUGIN_PATH
pathappend $QT5DIR/lib/plugins     QT_PLUGIN_PATH

pathappend /usr/lib/qt5/qml        QML2_IMPORT_PATH
pathappend $QT5DIR/lib/qml         QML2_IMPORT_PATH

# End extension for /etc/profile.d/qt5.sh</code>
EOF

cat &gt; /etc/profile.d/kf5.sh &lt;&lt; "EOF"
<code class="literal"># Begin /etc/profile.d/kf5.sh

export KF5_PREFIX=/usr

# End /etc/profile.d/kf5.sh</code>
EOF</kbd>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            If <span class="application">qt5</span> was installed in
            <code class="filename">/usr</code>, the <code class=
            "filename">$QT5DIR/lib/</code> portions of the above paths may
            need to be changed to <code class=
            "filename">$QT5DIR/lib/qt5/</code>.
          </p>
        </div>
        <p>
          Additionally, if <a class="xref" href="../postlfs/sudo.html" title=
          "Sudo-1.8.31p1">Sudo-1.8.31p1</a> is installed, these variables
          should be available to the super user. Execute the following
          commands as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">cat &gt;&gt; /etc/sudoers.d/qt &lt;&lt; "EOF"
<code class="literal">Defaults env_keep += QT_PLUGIN_PATH
Defaults env_keep += QML2_IMPORT_PATH</code>
EOF

cat &gt;&gt; /etc/sudoers.d/kde &lt;&lt; "EOF"
<code class="literal">Defaults env_keep += KF5_PREFIX</code>
EOF</kbd>
</pre>
      </div>
      <div class="sect2" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installing in /opt
        </h2>
        <p>
          A method of building multiple versions installs <span class=
          "application">KDE Frameworks 5</span> in the <code class=
          "filename">/opt</code> hierarchy:
        </p>
        <pre class="userinput">
<kbd class="command">export KF5_PREFIX=/opt/kf5</kbd>
</pre>
        <p>
          If you are not installing <span class="application">KDE Frameworks
          5</span> in <code class="filename">/usr</code>, you will need to
          make some additional configuration changes. Best practice is to add
          those to your system or personal profile:
        </p>
        <pre class="root">
<kbd class="command">cat &gt; /etc/profile.d/kf5.sh &lt;&lt; "EOF"
<code class="literal"># Begin /etc/profile.d/kf5.sh

export KF5_PREFIX=/opt/kf5

pathappend $KF5_PREFIX/bin              PATH
pathappend $KF5_PREFIX/lib/pkgconfig    PKG_CONFIG_PATH

pathappend $KF5_PREFIX/etc/xdg          XDG_CONFIG_DIRS
pathappend $KF5_PREFIX/share            XDG_DATA_DIRS

pathappend $KF5_PREFIX/lib/plugins      QT_PLUGIN_PATH
pathappend $KF5_PREFIX/lib/plugins/kcms QT_PLUGIN_PATH

pathappend $KF5_PREFIX/lib/qml          QML2_IMPORT_PATH

pathappend $KF5_PREFIX/lib/python3.8/site-packages PYTHONPATH

pathappend $KF5_PREFIX/share/man        MANPATH
# End /etc/profile.d/kf5.sh</code>
EOF

cat &gt;&gt; /etc/profile.d/qt5.sh &lt;&lt; "EOF"
<code class="literal"># Begin Qt5 changes for KF5

pathappend $QT5DIR/plugins             QT_PLUGIN_PATH
pathappend $QT5DIR/qml                 QML2_IMPORT_PATH

# End Qt5 changes for KF5</code>
EOF</kbd>
</pre>
        <p>
          Expand your <code class="filename">/etc/ld.so.conf</code> file:
        </p>
        <pre class="root">
<kbd class="command">cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF"
<code class="literal"># Begin KF5 addition

/opt/kf5/lib

# End KF5 addition</code>
EOF</kbd>
</pre>
        <p>
          Several <span class="application">KDE Frameworks 5</span> packages
          install files into <span class="application">D-Bus</span>
          directories. When installing <span class="application">KDE
          Frameworks 5</span> in a location other than <code class=
          "filename">/usr</code>, <span class="application">D-Bus</span>
          needs to be able to find these files. The easiest way to achieve
          this is to create the following symlinks (as the <code class=
          "systemitem">root</code> user):
        </p>
        <pre class="root">
<kbd class=
"command">install -v -dm755           $KF5_PREFIX/{etc,share} &amp;&amp;
ln -sfv /etc/dbus-1         $KF5_PREFIX/etc         &amp;&amp;
ln -sfv /usr/share/dbus-1   $KF5_PREFIX/share</kbd>
</pre>
        <p>
          Some packages may also install icons from the "hicolor" icon set.
          Since that icon set is used by many packages, it is a good idea to
          create a symlink to the one in <code class=
          "filename">/usr/share</code> to avoid having multiple installations
          of <a class="xref" href="../x/hicolor-icon-theme.html" title=
          "hicolor-icon-theme-0.17">hicolor-icon-theme-0.17</a>. Run the
          following commands as the <code class="systemitem">root</code>
          user:
        </p>
        <pre class="root">
<kbd class=
"command">install -v -dm755                $KF5_PREFIX/share/icons &amp;&amp;
ln -sfv /usr/share/icons/hicolor $KF5_PREFIX/share/icons</kbd>
</pre>
        <div class="admon tip">
          <img alt="[Tip]" src="../images/tip.png" />
          <h3>
            Tip
          </h3>
          <p>
            Sometimes, the installation paths are hardcoded into installed
            files. This is the reason why <code class=
            "filename">/opt/kf5</code> is used as installation prefix instead
            of <code class="filename">/opt/kf5-5.67.0</code>. After
            installing <span class="application">KDE Frameworks</span>, you
            may rename the directory and create a symlink:
          </p>
          <pre class="root">
<kbd class="command">mv /opt/kf5{,-5.67.0}
ln -sfv kf5-5.67.0 /opt/kf5</kbd>
</pre>
          <p>
            Later on, you may want to install other versions of <span class=
            "application">KDE Frameworks 5</span>. To do that, just remove
            the symlink and use <code class="filename">/opt/kf5</code> as the
            prefix again. Which version of <span class="application">KDE
            Frameworks 5</span> you use depends only on where the symlink
            points. No other reconfiguration will be needed.
          </p>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-08 05:20:09 -0500
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="kf5.html" title="KDE Frameworks 5">Prev</a>
          <p>
            KDE Frameworks 5
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="krameworks5.html" title=
          "Building KDE Frameworks 5 (KF5)">Next</a>
          <p>
            Building KDE Frameworks 5 (KF5)
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="kf5.html" title=
          "Chapter&nbsp;30.&nbsp;KDE Frameworks 5">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
